﻿@using Senparc.Weixin.MP.CoreSample.Models
@*DPBMARK_FILE TenPay*@
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>公众号H5支付测试网页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
    <script src="~/lib/jquery/dist/jquery.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1" />
    <style>
        body {
            margin: 0;
            padding: 0;
            background: #eae9e6;
        }

        body, p, table, td, th {
            font-size: 14px;
            font-family: helvetica,Arial,Tahoma;
        }

        h1 {
            font-family: Baskerville,HelveticaNeue-Bold,helvetica,Arial,Tahoma;
        }

        a {
            text-decoration: none;
            color: #385487;
        }

        .product {
            font-size: 200%;
            color: #a5a5a5;
        }

        .title h1 {
            font-size: 22px;
            font-weight: bold;
            padding: 0;
            margin: 0;
            line-height: 1.2;
            color: #1f1f1f;
        }

        .title p {
            color: #aaa;
            font-size: 12px;
            margin: 5px 0 0;
            padding: 0;
            font-weight: bold;
        }

        .WCPay {
            padding-top: 3%;
        }
    </style>
    <script>
        function auto_remove(img) {
            div = img.parentNode.parentNode; div.parentNode.removeChild(div);
            img.onerror = "";
            return true;
        }

        function changefont(fontsize) {
            if (fontsize < 1 || fontsize > 4) return;
            $('#content').removeClass().addClass('fontSize' + fontsize);
        }

        $(function() {
            jQuery('a#getBrandWCPayRequest').click(function () {
                location.href = '@Html.Raw(ViewData["MWebUrl"])';
            });
        });

        if (jQuery) {
            jQuery(function () {

                var width = jQuery('body').width() * 0.87;
                jQuery('img').error(function () {
                    var self = jQuery(this);
                    var org = self.attr('data-original1');
                    self.attr("src", org);
                    self.error(function () {
                        auto_remove(this);
                    });
                });
                jQuery('img').each(function () {
                    var self = jQuery(this);
                    var w = self.css('width');
                    var h = self.css('height');
                    w = w.replace('px', '');
                    h = h.replace('px', '');
                    if (w <= width) {
                        return;
                    }
                    var new_w = width;
                    var new_h = Math.round(h * width / w);
                    self.css({ 'width': new_w + 'px', 'height': new_h + 'px' });
                    self.parents('div.pic').css({ 'width': new_w + 'px', 'height': new_h + 'px' });
                });
            });
        }
    </script>
</head>
<body>
    <div class="WCPay">
        <a id="getBrandWCPayRequest" href="javascript:void(0);">
            @if (ViewData["product"] is ProductModel)
            {
                var product = (ProductModel)ViewData["product"];
                <div class="product">
                    您已选中产品：@product.Name<br />
                    单价：@product.Price.ToString("c")
                </div>
            }
            <h1 class="title">点击提交可体验H5微信支付</h1>
        </a>
        <p>注意：H5支付用于已经安装微信的手机客户端，使用微信外部浏览器网页内的支付。</p>
    </div>
</body>
</html>
